package com.spring.demo.web;/**
 * Created by liujun on 2018/6/1.
 */

import com.spring.demo.repository.UserRepository;
import com.spring.demo.vo.UserVo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Administrator
 * @create 2018-06-01 17:11
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserRepository userRepository;


    @GetMapping("/users" )
    public    List<UserVo> findAll(){
        List<UserVo> userVos=userRepository.findAll();
        return userVos;
    }
}
